#include <stdio.h>
#include <malloc.h>

int global_value = 1;
static int static_global_value = 1;

int main()
{
    static int static_locality_value = 1;
    int value = 1;
    int arr[5] = {1, 2, 3, 4, 5};
    char carr[] = "abcdef";
    const char *cp = "abcd";
    int *p1 = (int *)malloc(sizeof(int) * 4);
    int *p2 = (int *)calloc(5, sizeof(int));
    int *p3 = (int *)realloc(p1, sizeof(int) * 8);
    free(p1);
    free(p2);

    return 0;
}

// global_value、static_global_value、static_locality_value -> 数据段
// value、arr、carr、cp、p1、p2、p3 -> 栈区
// "abcdef"、"abcd" -> 代码段
//(int *)malloc(sizeof(int) * 4)、(int *)calloc(5, sizeof(int))、(int *)realloc(p1, sizeof(int) * 8) -> 堆区
